package com.fc.mall.decoration.component.model;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import com.fc.mall.util.Utils;

@Getter
@Setter
@Document(collection = "components")
public class Component {

    @Id
    private String id;
    @Indexed
    private String name;
    private int orderNo;
    private String platformNo;
    private int parentId;
    public static Component createNew() {
        Component comp = new Component();
        comp.setId(Utils.generateId());
        return comp;
    }
}
